package com.dsbj.it.DingTalkBotStarter.util;

import com.alibaba.excel.EasyExcel;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class ExcelReader {



    public static ExcelListener df(String filepath){
        //初始化本地Excel文件流
        File file = new File(filepath);
        FileInputStream fis = null;
        try {
            fis = new FileInputStream(file);
            //使用监听器处理文件流
            ExcelListener parseListener = new ExcelListener();
            EasyExcel.read(fis, parseListener).sheet().doRead();
            return parseListener;
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        }
    }
}
